package com.uinnova.product.eam.mvc;

import com.binary.framework.web.RemoteResult;
import com.binary.jdbc.Page;
import com.uinnova.product.eam.dto.SimpProjectInfo;
import com.uinnova.product.eam.model.es.ProjectInfo;
import com.uinnova.product.eam.service.ProjectService;
import com.uinnova.product.eam.vo.ProjectQueryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/project")
public class ProjectController {

    @Autowired
    private ProjectService projectService;

    @PostMapping("/list")
    public RemoteResult list(@RequestBody ProjectQueryVo queryVo) {
        Page<SimpProjectInfo> page = projectService.list(queryVo);
        return new RemoteResult(page);
    }

    @GetMapping("/queryRequireDocUrl")
    public RemoteResult queryRequireDocUrl(@RequestParam String ciCode) {
        ProjectInfo projectInfo = projectService.queryRequireDocUrl(ciCode);
        return new RemoteResult(projectInfo);
    }
}
